window.onload = function () {
    //配置
    var config = {
        vx: 4,//点x轴速度,正为右，负为左
        vy: 4,//点y轴速度
        height: 2,//点高宽，其实为正方形，所以不宜太大
        width: 2,
        count: 100,//点个数
        color: "100, 100, 100",//点颜色
        stroke: "50,50,50",//线条颜色
        dist: 6000,//点吸附距离
        e_dist: 20000,//鼠标吸附加速距离
        max_conn: 10//点到点最大连接数
    }
    //调用
    CanvasParticle(config, 'MyDiv');
}

function test(){
    //点击对应次数后，样式改变，下面价格对应改变， 单价也改变
    let iteams=document.querySelectorAll(".banner .ner-min .banner-right .test .iteam")
    let price=document.querySelector(".banner .ner-min .banner-right .total .price")
    let unitprc=document.querySelector(".banner .ner-min .banner-right .total .unitprc")
    iteams.forEach((i,j) => {
        i.addEventListener("click",function(){
            iteams.forEach((k) => {
                k.classList.remove("active")
            });
            i.classList.add("active")
            price.textContent=i.dataset.ss
            unitprc.textContent=i.dataset.unit
        })
    });
}
test()


function slide(){
    let div=document.querySelector(".ner-min .banner-right .test .saoma")
    let divs=document.querySelector(".ner-min .banner-right .test .saoma div")
    div.addEventListener("mouseenter",function(){
        divs.style.height="120px"
    })
    div.addEventListener("mouseleave",function(){
        divs.style.height="0px"
    })
}
slide()

function switchs(){
    let spans=document.querySelectorAll("main .information .columns .title span")
    let lis=document.querySelectorAll("main .information .uthentication-left li")
    spans.forEach((i,j) => {
        i.addEventListener("click",function(){
            spans.forEach((k,s) => {
                k.classList.remove("active")
                lis[s].classList.remove("on")
            });
            i.classList.add("active")
            lis[j].classList.add("on")
        })
    });
}
switchs()